occupy (someone's) mind

Translations
занимать (чей-то) ум
The problem continued to occupy her mind for days.
Проблема продолжала занимать её ум в течение нескольких дней.
Definitions
To engage someone's thoughts or attention, often to the extent that they are preoccupied or distracted from other matters.